
#include "GSLVectorWrapper.h"

#include <iomanip>

GSLVectorWrapper::GSLVectorWrapper(const gsl_vector *x) : x_(x) { }

const gsl_vector *GSLVectorWrapper::operator->() const
{
  return x_;
}

ostream &operator<<(ostream &os, const GSLVectorWrapper &v)
{
  os<<"[";
  for(unsigned int i = 0; i < v.x_->size; i++)
  {
    os<<setprecision(5)<<left<<gsl_vector_get(v.x_, i);
    if(i < v.x_->size - 1)
      os<<", ";
  }
  os<<"]";
  
  return os;
}
